<?php
/**
 * Extension of SQLConditionsClause providing vendor-specific functionality.
 */
class MySQLConditionsClause extends SQLConditionsClause {
	public static function getInstance() {
		return new MySQLConditionsClause();
	}
	
	/**
	 * Sets up a "REGEXP/NOT REGEXP" condition.
	 * 
	 * @example ("g", new SQLValue("new\\*.\\*line"))
	 * @param SQLValue|string $key
	 * @param string $pattern
	 * @param boolean $blnIsRegexp
	 * @return SQLConditionsClause
	 */
	public function setRegexp($key, $pattern, $blnIsTrue=true) {
		$tblClause = array();
		$tblClause["KEY"]=$key;
		$tblClause["COMPARATOR"]=($blnIsTrue?MySQLComparisonOperators::REGEXP:MySQLComparisonOperators::NOT_REGEXP);
		$tblClause["VALUE"]=$pattern;
		$this->tblContents[]=$tblClause;
		return $this;
	}
}